package com.solution.admin.auth.constants;

/**
 * 授权模块的常量
 * 
 * @author llp
 */
public class AuthConstants {

	// 记录状态 status
	public enum USER_STATUS {
		ENABLED(1, "启用"), DISABLED(0, "停用");
		private Integer id;
		private String name;

		private USER_STATUS(Integer id, String name) {
			this.id = id;
			this.name = name;
		}

		public Integer getId() {
			return id;
		}

		public void setId(Integer id) {
			this.id = id;
		}

		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}
	}

	// 记录状态 role_status
	public enum ROLE_STATUS {
		ENABLED(1, "启用"), DISABLED(0, "停用");
		private Integer id;
		private String name;

		private ROLE_STATUS(Integer id, String name) {
			this.id = id;
			this.name = name;
		}

		public Integer getId() {
			return id;
		}

		public void setId(Integer id) {
			this.id = id;
		}

		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}

	}

	// IS_DELETE 删除标记
	public enum IS_DELETE {
		DELETED(0, "已删除"), NOT_DELETE(1, "正常");
		private Integer id;
		private String name;

		private IS_DELETE(Integer id, String name) {
			this.id = id;
			this.name = name;
		}

		public Integer getId() {
			return id;
		}

		public void setId(Integer id) {
			this.id = id;
		}

		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}

	}

	/**
	 * 页面操作类型
	 * 
	 * @author llp
	 */
	public enum OPERATE_TYPE {
		ADD(1, "新增"), EDIT(2, "修改");
		private Integer id;
		private String name;

		private OPERATE_TYPE(Integer id, String name) {
			this.id = id;
			this.name = name;
		}

		public Integer getId() {
			return id;
		}

		public void setId(Integer id) {
			this.id = id;
		}

		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}
	}

	/**
	 * shiro 用户加密参数
	 * 
	 * @author llp
	 */
	public enum SIMPLE_HASH_PARAM {
		MD5(1, "MD5"), ENCTRY_TIMES(2, "1"), DEFAULT_PWD(3, "123456");
		private Integer id;
		private String name;

		private SIMPLE_HASH_PARAM(Integer id, String name) {
			this.id = id;
			this.name = name;
		}

		public Integer getId() {
			return id;
		}

		public void setId(Integer id) {
			this.id = id;
		}

		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}
	}

	/**
	 * 新增方法请求结果
	 * 
	 * @author llp
	 */
	public enum ADD_RESULT {
		SUCCESS("1", "新增成功"), FAILED("0", "新增失败");
		private String code;
		private String msg;

		private ADD_RESULT(String code, String msg) {
			this.code = code;
			this.msg = msg;
		}

		public String getCode() {
			return code;
		}

		public void setCode(String code) {
			this.code = code;
		}

		public String getMsg() {
			return msg;
		}

		public void setMsg(String msg) {
			this.msg = msg;
		}

	}

	/**
	 * 编辑方法请求结果
	 * 
	 * @author llp
	 */
	public enum EDIT_RESULT {
		SUCCESS("1", "编辑成功"), FAILED("0", "编辑失败");
		private String code;
		private String msg;

		private EDIT_RESULT(String code, String msg) {
			this.code = code;
			this.msg = msg;
		}

		public String getCode() {
			return code;
		}

		public void setCode(String code) {
			this.code = code;
		}

		public String getMsg() {
			return msg;
		}

		public void setMsg(String msg) {
			this.msg = msg;
		}

	}

	
	
	/**
	 * 系统登录终端类型
	 * @author llp
	 */
	public enum LOGIN_TERMINAL_TYPE {
		WX("WX", "微信"), 
		PC("PC", "电脑端"),
		BACKEND("BACKEND", "管理后台");
		private String code;
		private String name;

		private LOGIN_TERMINAL_TYPE(String code, String name) {
			this.code = code;
			this.name = name;
		}

		public String getCode() {
			return code;
		}

		public void setCode(String code) {
			this.code = code;
		}

		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}

	}
	
	
	/**
	 * 测试示例
	 * 
	 * @param args
	 */
	public static void main(String[] args) {
		AuthConstants.USER_STATUS.DISABLED.getId();
	}

}
